Upgrade IdWeb Sidecar to .NET 10 (LTS)#3841
Conversation
@microsoft-github-policy-service agree company="Microsoft" |
51685ab to
2b7636f
Compare
@microsoft-github-policy-service agree company="Microsoft" |
iNinja
left a comment
There was a problem hiding this comment.
Good, clean upgrade. The OpenAPI.NET v2 breaking changes are handled correctly, and the ForceRefresh schema bug is a nice fix. One missed file is a blocker.
Dockerfile (lines 6 and 11) — blocking
The plain Dockerfile (used for local builds and Visual Studio) wasn't updated in this PR. Lines 6 and 11 still reference .NET 9:
dockerfile FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
After this merges, docker build locally or building via VS will produce a .NET 9 image while the project targets net10.0. Both references need bumping to 10.0.
There was a problem hiding this comment.
Pull request overview
This PR upgrades the Microsoft.Identity.Web Sidecar project and its E2E tests from .NET 9 to .NET 10 (LTS), aligning the Sidecar’s runtime, dependencies, and container images with the supported platform baseline.
Changes:
- Bumped Sidecar and Sidecar E2E tests to
net10.0, and updated ASP.NET Core dependency versions to10.0.0. - Updated Sidecar OpenAPI helpers to accommodate OpenAPI.NET v2 API/namespace changes (e.g.,
JsonSchemaType). - Updated Sidecar Docker base images to ASP.NET Core
10.0and suppressed new .NET 10 entry-point trim-analyzer restrictions via pragmas.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/E2E Tests/Sidecar.Tests/Sidecar.Tests.csproj | Moves Sidecar E2E tests to net10.0 and updates Microsoft.AspNetCore.Mvc.Testing to 10.0.0. |
| src/Microsoft.Identity.Web.Sidecar/Program.cs | Adds analyzer warning suppressions for .NET 10 entry-point attribute restrictions. |
| src/Microsoft.Identity.Web.Sidecar/OptionsOverrideSchemaTransformer.cs | Updates OpenAPI namespace import for OpenAPI.NET v2 compatibility. |
| src/Microsoft.Identity.Web.Sidecar/OpenApiDescriptions.cs | Updates OpenAPI schema typing to JsonSchemaType and adds parameter null guards. |
| src/Microsoft.Identity.Web.Sidecar/DockerFile.NanoServer | Updates NanoServer ASP.NET runtime base image from 9.0 to 10.0. |
| src/Microsoft.Identity.Web.Sidecar/Dockerfile.AzureLinux | Updates AzureLinux distroless ASP.NET runtime base image from 9.0 to 10.0. |
| src/Microsoft.Identity.Web.Sidecar/Directory.Build.props | Updates Sidecar TFM to net10.0 and bumps Sidecar ASP.NET dependency version to 10.0.0. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SidecarEndpointsE2ETests require Azure AD lab credentials that are not available in CI when running from fork PRs. The net9.0 test step already excludes these tests, but the net10.0 step was missing the same filter, causing CI failures on fork PRs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Upgrade Sidecar from .NET 9 (EOL) to .NET 10 (LTS).
Description
.NET 9 reached end-of-life. This PR upgrades the Sidecar project to .NET 10 (LTS, supported until Nov 2028).
Changes
Version bump (3 files):
Directory.Build.props:net9.0→net10.0,SidecarAspDependencyVersion9.0.9→10.0.0Dockerfile.AzureLinux: base imageaspnet:9.0-azurelinux3.0-distroless→10.0DockerFile.NanoServer: base imageaspnet:9.0-nanoserver-ltsc2022→10.0Dockerfile: base imagesaspnet:9.0/sdk:9.0→10.0(local/VS builds)OpenAPI v2 breaking changes (2 files):
Microsoft.AspNetCore.OpenApi10.0 ships with OpenAPI.NET v2, which has namespace and type changes:OpenApiDescriptions.cs:using Microsoft.OpenApi.Models→using Microsoft.OpenApi;Schema.Typechanged fromstringtoJsonSchemaTypeenum; added null guards forop.ParametersOptionsOverrideSchemaTransformer.cs: namespace update onlyAddAcquireTokenOptionparameter order to matchAddSimple(name, type, desc) — fixes a pre-existing bug whereForceRefreshhad its description and type arguments silently swappedTrimmer attribute restriction (1 file):
Program.cs: .NET 10 disallows[RequiresUnreferencedCode]/[RequiresDynamicCode]on entry points (IL2123/IL3057). Added pragma suppression.Test project update (1 file)
Sidecar.Tests.csproj:net9.0→net10.0,Microsoft.AspNetCore.Mvc.Testing9.0.0 → 10.0.0CI workflow fix (1 file)
.github/workflows/dotnetcore.yml: AddedSidecarEndpointsE2ETestsexclusion to the net10.0 test step. These are E2E tests that require Azure AD lab credentials (client certificates inLocalMachine/Mystore) which are not available in GitHub Actions CI. The net9.0 test step already had this exclusion; the net10.0 step was missing it. The tests are also guarded by a#if !FROM_GITHUB_ACTIONpreprocessor directive, but the test filter is needed as an additional safeguard since the test assembly still gets discovered bydotnet test.Testing
dotnet publishsucceeds targetingnet10.0GET /healthz→ 200GET /Validatewith Bearer token → 200